package com.company.作业;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        System.out.println("请输入菱形边长:");
        Scanner in=new Scanner(System.in);
        int a=in.nextInt();
        for (int i = 1; i <=a; i++) {
            for (int j = 1; j <=a-i; j++) {
                System.out.print(" ");
            }
            for (int j = 1; j <=2*i-1 ; j++) {
                if((j==1)||(j==2*i-1)){
                    System.out.print("*");
                }
                else{
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
        for (int i = a-1; i >=1 ; i--) {
            for (int j = 1; j <=a-i ; j++) {
                System.out.print(" ");
            }
            for (int j = 1; j <=2*i-1 ; j++) {
                if((j==1)||(j==2*i-1)){
                    System.out.print("*");
                }
                else{
                    System.out.print(" ");
                }

            }
            System.out.println();
        }

    }
}














